<h1><?= $head_title ?></h1>

<!-- Muestra mensajes sobre campos inválidos. -->
<?php if (!empty($messages)): ?>
<div>
	<?php foreach ($messages as $text): ?>
		<p><mark><?= $text ?>.</mark></p>
	<?php endforeach ?>
</div>
<?php endif ?>

<form method="POST" action="<?= $url_routes['signup'] ?>">
	<input type="hidden" name="csrf" value="<?= $token ?>">
	<div>
		<label for="name">Nombre completo</label>
		<input type="text" id="name" name="name" minlength="5" maxlength="255" autofocus required>
	</div>
	<div>
		<label for="username">Apodo</label>
		<input type="text" id="username" name="username" minlength="1" maxlength="255" required>
	</div>
	<div>
		<label for="email">Correo institucional</label>
		<input type="email" id="email" name="email" minlength="5" maxlength="255" required>
	</div>
	<div>
		<label for="password">Constraseña</label>
		<input type="password" id="password" name="password" minlength="6" maxlength="255" required>
	</div>
	<div>
		<label for="password_confirm">Confirmar contraseña</label>
		<input type="password" id="password_confirm" name="password_confirm" minlength="6" maxlength="255" required>
	</div>
	<div>
		<input type="submit" name="signup_submit" value="<?= $head_title ?>">
		<p>¿Ya tienes cuenta? <a href="<?= $url_routes['login'] ?>">Inicia sesión</a>.</p>
	</div>
</form>
